home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 97 / CD-ROM 97 / CD-ROM 97.iso / jogos / spherical / Code / Game / initialize.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-08-15  |  16.2 KB  |  484 lines

  1.  
  2. // Copyright (C) 2002 by Luigi Pino.  All Rights Reserved.
  3.  
  4. /***************************************************************************/
  5.  
  6. #include "../library/neurosis.h"
  7. #include "draw.h"
  8. #include "file_io.h"
  9. #include "hiscore.h"
  10. #include "initialize.h"
  11. #include "main.h"
  12. #include "menu_misc.h"
  13. #include "paddle.h"
  14. #include "sphere.h"
  15. #include "update.h"
  16.  
  17. /***************************************************************************/
  18.  
  19. Controller_Class                    input;
  20.  
  21. extern Camera_Class                camera;
  22. extern Mouse_Class                mouse;
  23. extern Object3_Class            ground_cover;
  24. extern Object4_Class            ground;
  25. extern Object4_Class            wall_net;
  26. extern Object4_Class            wall_side;
  27. extern Paddle_Struct            paddle_object[];
  28. extern Shadow_Box_Struct    light_source;
  29. extern Values_Struct            values;
  30. extern Sub_Menu_Class            menu_options;
  31. extern Window_Class                window;
  32.  
  33. extern bool                                connected[];
  34. extern float3                            wall_pts[];
  35. extern int                                goal_by_team;
  36.  
  37. /***************************************************************************/
  38.  
  39. void Initialize_Game()
  40.  
  41. {
  42.     input.Clear();
  43.     mouse.Clear();
  44.  
  45.     for (int x1=0;x1<values.sphere_number;x1=x1+1)
  46.         Initialize_Sphere_Object(x1);
  47.  
  48.     goal_by_team = -1;
  49.  
  50.     Initialize_Paddle_Object();
  51.     Initialize_Wall_Points(40.0f, 200.0f, 300.0f);
  52.  
  53.     camera.axis_current.x = camera.axis_destination.x = 320.0f;
  54.     camera.axis_current.z = camera.axis_destination.z = 0.0f;
  55.     camera.axis_speed = 30.0f;
  56.     camera.zoom_current = camera.zoom_destination = -500.0f;
  57.     camera.zoom_speed = 100.0f;
  58.  
  59.     values.fade_amount = 0.0f;
  60.     values.game_end_fade = false;
  61.     values.game_start_fade = true;
  62.     values.paddle_speed = 65.0f;
  63.     values.wall_height = 50.0f;
  64.  
  65.     // Change sound to current menu choice
  66.     if (menu_options.Get_Current_Choice(0) == 0)
  67.         values.sound = true;
  68.     else
  69.         values.sound = false;
  70.  
  71.     if (paddle_object[Up].input.user == No_User)
  72.         {
  73.             wall_pts[35].x = -20.0f;
  74.             wall_pts[36].x = 20.0f;
  75.             wall_pts[35].y = wall_pts[36].y = 185.0f;
  76.         }
  77.  
  78.     if (paddle_object[Down].input.user == No_User)
  79.         {
  80.             wall_pts[12].x = -20.0f;
  81.             wall_pts[11].x = 20.0f;
  82.             wall_pts[11].y = wall_pts[12].y = -185.0f;
  83.         }
  84.  
  85.     if (paddle_object[Left].input.user == No_User)
  86.         {
  87.             wall_pts[23].x = wall_pts[24].x = -185.0f;
  88.             wall_pts[23].y = -20.0f;
  89.             wall_pts[24].y = 20.0f;
  90.         }
  91.  
  92.     if (paddle_object[Right].input.user == No_User)
  93.         {
  94.             wall_pts[47].x = wall_pts[48].x = 185.0f;
  95.             wall_pts[48].y = -20.0f;
  96.             wall_pts[47].y = 20.0f;
  97.         }
  98.  
  99.     Initialize_Ground();
  100.     Initialize_Ground_Cover();
  101.     Initialize_Wall();
  102. }
  103.  
  104. /***************************************************************************/
  105.  
  106. void Initialize_Ground()
  107.  
  108. {
  109.     int x1;
  110.     int y1;
  111.  
  112.     ground.Set_Texture_Image(t_inside_ground);
  113.  
  114.     for (x1=0;x1<10;x1=x1+1)
  115.         for (y1=0;y1<10;y1=y1+1)
  116.             {
  117.                 ground.Set_Position(y1 + (x1 * 10), -190.0f + ((float)(x1) * 38.0f), -190.0f + ((float)(y1 + 1) * 38.0f), 0.0f,
  118.                     -190.0f + ((float)(x1 + 1) * 38.0f), -190.0f + ((float)(y1 + 1) * 38.0f), 0.0f,
  119.                     -190.0f + ((float)(x1 + 1) * 38.0f), -190.0f + ((float)(y1) * 38.0f), 0.0f, -190.0f + ((float)(x1) * 38),
  120.                     -190.0f + ((float)(y1) * 38.0f), 0.0f);
  121.             }
  122. }
  123.  
  124. /***************************************************************************/
  125.  
  126. void Initialize_Ground_Cover()
  127.  
  128. {
  129.     color3    color = {0.0f, 0.0f, 0.0f};
  130.     float3    top_left = {-200.0f, 200.0f, 1.0f};
  131.     float3    top_right = {200.0f, 200.0f, 1.0f};
  132.     float3    bottom_right = {200.0f, -200.0f, 1.0f};
  133.     float3    bottom_left = {-200.0f, -200.0f, 1.0f};
  134.     int            x1;
  135.  
  136.     // Top Left
  137.     for (x1=0;x1<11;x1=x1+1)
  138.         {
  139.             ground_cover.Set_Color(x1, &color, &color, &color);
  140.             ground_cover.Set_Position(x1, &top_left, &wall_pts[24 + x1], &wall_pts[25 + x1]);
  141.         }
  142.  
  143.     // Top Right
  144.     for (x1=0;x1<11;x1=x1+1)
  145.         {
  146.             ground_cover.Set_Color(11 + x1, &color, &color, &color);
  147.             ground_cover.Set_Position(11 + x1, &top_right, &wall_pts[36 + x1], &wall_pts[37 + x1]);
  148.         }
  149.  
  150.     // Bottom Right
  151.     ground_cover.Set_Color(22, &color, &color, &color);
  152.     ground_cover.Set_Position(22, &bottom_right, &wall_pts[48], &wall_pts[49]);
  153.  
  154.     for (x1=0;x1<10;x1=x1+1)
  155.         {
  156.             ground_cover.Set_Color(23 + x1, &color, &color, &color);
  157.             ground_cover.Set_Position(23 + x1, &bottom_right, &wall_pts[1 + x1], &wall_pts[2 + x1]);
  158.         }
  159.  
  160.     // Bottom Left
  161.     for (x1=0;x1<11;x1=x1+1)
  162.         {
  163.             ground_cover.Set_Color(33 + x1, &color, &color, &color);
  164.             ground_cover.Set_Position(33 + x1, &bottom_left, &wall_pts[12 + x1], &wall_pts[13 + x1]);
  165.         }
  166.  
  167.     // Top net cover
  168.     ground_cover.Set_Color(44, &color, &color, &color);
  169.     ground_cover.Set_Position(44, &top_left, &top_right, &wall_pts[35]);
  170.     ground_cover.Set_Color(45, &color, &color, &color);
  171.     ground_cover.Set_Position(45, &top_right, &wall_pts[35], &wall_pts[36]);
  172.  
  173.     // Right net cover
  174.     ground_cover.Set_Color(46, &color, &color, &color);
  175.     ground_cover.Set_Position(46, &top_right, &bottom_right, &wall_pts[47]);
  176.     ground_cover.Set_Color(47, &color, &color, &color);
  177.     ground_cover.Set_Position(47, &bottom_right, &wall_pts[47], &wall_pts[48]);
  178.  
  179.     // Bottom net cover
  180.     ground_cover.Set_Color(48, &color, &color, &color);
  181.     ground_cover.Set_Position(48, &bottom_right, &bottom_left, &wall_pts[11]);
  182.     ground_cover.Set_Color(49, &color, &color, &color);
  183.     ground_cover.Set_Position(49, &bottom_left, &wall_pts[11], &wall_pts[12]);
  184.  
  185.     // Right net cover
  186.     ground_cover.Set_Color(50, &color, &color, &color);
  187.     ground_cover.Set_Position(50, &bottom_left, &top_left, &wall_pts[23]);
  188.     ground_cover.Set_Color(51, &color, &color, &color);
  189.     ground_cover.Set_Position(51, &top_left, &wall_pts[23], &wall_pts[24]);
  190. }
  191.  
  192. /***************************************************************************/
  193.  
  194. bool Initialize_Objects()
  195.  
  196. {
  197.     bool okay[4];
  198.  
  199.     okay[0] = ground.Set_Size(100);
  200.     okay[1] = ground_cover.Set_Size(52);
  201.     okay[2] = wall_net.Set_Size(4);
  202.     okay[3] = wall_side.Set_Size(44);
  203.  
  204.     for (int x1=0;x1<4;x1=x1+1)
  205.         {
  206.             if (okay[x1] == false)
  207.                 return (false);
  208.         }
  209.  
  210.     return (true);
  211. }
  212.  
  213. /***************************************************************************/
  214.  
  215. void Initialize_System()
  216.  
  217. {
  218.     light_source.color.r = 1.0f;
  219.     light_source.color.g = 1.0f;
  220.     light_source.color.b = 1.0f;
  221.     light_source.brightness = 2.6f;
  222.     light_source.range = 300.0f;
  223.     light_source.position.z = 180.0f;
  224.     values.game_position = Game_Intro;
  225.     values.intro_count = 0.0f;
  226.  
  227.     srand((unsigned)time(NULL));
  228.     window.zNear = 20.0f;
  229.     window.zFar = 6000.0f;
  230.  
  231.     connected[Keyboard_1] = true;
  232.     connected[Keyboard_2] = true;
  233.     connected[Computer] = true;
  234.     connected[No_User] = true;
  235.  
  236.     // 0        - OK
  237.     // 165    - Not hooked up
  238.     // 167    - Unplugged
  239.     JOYINFOEX    joystick_check;
  240.     joystick_check.dwSize = sizeof(JOYINFOEX);
  241.  
  242.     for (int x1=Joystick_1;x1<=Joystick_4;x1=x1+1)
  243.         {
  244.             if (joyGetPosEx(x1 - Joystick_1, &joystick_check) == 0)
  245.                 connected[x1] = true;
  246.             else
  247.                 connected[x1] = false;
  248.         }
  249. }
  250.  
  251. /***************************************************************************/
  252.  
  253. void Initialize_Textures(bool change_resolution)
  254.  
  255. {
  256.     if (change_resolution == false)
  257.         {
  258.             window.Load_Texture(t_menu_1, "Data/intro_1.bmp");
  259.             window.Load_Texture(t_menu_2, "Data/intro_2.bmp");
  260.         }
  261.     else
  262.         {
  263.             window.Load_Texture(t_menu_1, "Data/menu_1.bmp");
  264.             window.Load_Texture(t_menu_2, "Data/menu_2.bmp");
  265.         }
  266.  
  267.     window.Load_Texture(t_font, "Data/font.bmp");
  268.     window.Load_Texture(t_font_mask, "Data/font_mask.bmp");
  269.     window.Load_Texture(t_menu_3, "Data/intro_3.bmp");
  270.     window.Load_Texture(t_menu_mask_1, "Data/menu_mask_1.bmp");
  271.     window.Load_Texture(t_menu_mask_2, "Data/menu_mask_2.bmp");
  272.     window.Load_Texture(t_inside_ground, "Data/inside_ground.bmp");
  273.     window.Load_Texture(t_side_wall, "Data/side_wall.bmp");
  274.     window.Load_Texture(t_net_wall, "Data/net_wall.bmp");
  275.     window.Load_Texture(t_paddle, "Data/paddle.bmp");
  276.     window.Load_Texture(t_arrow, "Data/arrow.bmp");
  277.     window.Load_Texture(t_sphere, "Data/sphere.bmp");
  278. }
  279.  
  280. /***************************************************************************/
  281.  
  282. void Initialize_Wall()
  283.  
  284. {
  285.     int x1;
  286.  
  287.     wall_net.Set_Texture_Image(t_net_wall);
  288.     wall_side.Set_Texture_Image(t_side_wall);
  289.  
  290.     // Bottom Right Corner
  291.     for (x1=0;x1<9;x1=x1+1)
  292.         {
  293.             wall_side.Set_Texture_Position(x1, 0.111f * x1, 1.0f, (1 + x1) * 0.111f, 1.0f, (1 + x1) * 0.111f, 0.0f, 0.111f * x1, 0.0f);
  294.             wall_side.Set_Position(x1, wall_pts[1 + x1].x, wall_pts[1 + x1].y, values.wall_height, wall_pts[2 + x1].x,
  295.                 wall_pts[2 + x1].y, values.wall_height, wall_pts[2 + x1].x, wall_pts[2 + x1].y, 0.0f, wall_pts[1 + x1].x,
  296.                 wall_pts[1 + x1].y, 0.0f);
  297.         }
  298.  
  299.     // Bottom Wall
  300.     wall_side.Set_Position(9, wall_pts[10].x, wall_pts[10].y, values.wall_height, wall_pts[11].x, wall_pts[11].y,
  301.         values.wall_height, wall_pts[11].x, wall_pts[11].y, 0.0f, wall_pts[10].x, wall_pts[10].y, 0.0f);
  302.  
  303.     wall_net.Set_Position(0, wall_pts[11].x, wall_pts[11].y, values.wall_height, wall_pts[12].x, wall_pts[12].y,
  304.         values.wall_height, wall_pts[12].x, wall_pts[12].y, 0.0f, wall_pts[11].x, wall_pts[11].y, 0.0f);
  305.  
  306.     wall_side.Set_Position(10, wall_pts[12].x, wall_pts[12].y, values.wall_height, wall_pts[13].x, wall_pts[13].y,
  307.         values.wall_height, wall_pts[13].x, wall_pts[13].y, 0.0f, wall_pts[12].x, wall_pts[12].y, 0.0f);
  308.  
  309.     // Bottom Left Corner
  310.     for (x1=0;x1<9;x1=x1+1)
  311.         {
  312.             wall_side.Set_Texture_Position(x1+11, 0.111f * x1, 1.0f, (1 + x1) * 0.111f, 1.0f, (1 + x1) * 0.111f, 0.0f, 0.111f * x1, 0.0f);
  313.             wall_side.Set_Position(x1+11, wall_pts[13 + x1].x, wall_pts[13 + x1].y, values.wall_height, wall_pts[14 + x1].x,
  314.                 wall_pts[14 + x1].y, values.wall_height, wall_pts[14 + x1].x, wall_pts[14 + x1].y, 0.0f, wall_pts[13 + x1].x,
  315.                 wall_pts[13 + x1].y, 0.0f);
  316.         }
  317.  
  318.     // Left Wall
  319.     wall_side.Set_Position(20, wall_pts[22].x, wall_pts[22].y, values.wall_height, wall_pts[23].x, wall_pts[23].y,
  320.         values.wall_height, wall_pts[23].x, wall_pts[23].y, 0.0f, wall_pts[22].x, wall_pts[22].y, 0.0f);
  321.  
  322.     wall_net.Set_Position(1, wall_pts[23].x, wall_pts[23].y, values.wall_height, wall_pts[24].x, wall_pts[24].y,
  323.         values.wall_height, wall_pts[24].x, wall_pts[24].y, 0.0f, wall_pts[23].x, wall_pts[23].y, 0.0f);
  324.  
  325.     wall_side.Set_Position(21, wall_pts[24].x, wall_pts[24].y, values.wall_height, wall_pts[25].x, wall_pts[25].y,
  326.         values.wall_height, wall_pts[25].x, wall_pts[25].y, 0.0f, wall_pts[24].x, wall_pts[24].y, 0.0f);
  327.  
  328.     // Top Left Corner
  329.     for (x1=0;x1<9;x1=x1+1)
  330.         {
  331.             wall_side.Set_Texture_Position(x1+22, 0.111f * x1, 1.0f, (1 + x1) * 0.111f, 1.0f, (1 + x1) * 0.111f, 0.0f, 0.111f * x1, 0.0f);
  332.             wall_side.Set_Position(x1+22, wall_pts[25 + x1].x, wall_pts[25 + x1].y, values.wall_height, wall_pts[26 + x1].x,
  333.                 wall_pts[26 + x1].y, values.wall_height, wall_pts[26 + x1].x, wall_pts[26 + x1].y, 0.0f, wall_pts[25 + x1].x,
  334.                 wall_pts[25 + x1].y, 0.0f);
  335.         }
  336.  
  337.     // Top Wall
  338.     wall_side.Set_Position(31, wall_pts[34].x, wall_pts[34].y, values.wall_height, wall_pts[35].x, wall_pts[35].y,
  339.         values.wall_height, wall_pts[35].x, wall_pts[35].y, 0.0f, wall_pts[34].x, wall_pts[34].y, 0.0f);
  340.  
  341.     wall_net.Set_Position(2, wall_pts[35].x, wall_pts[35].y, values.wall_height, wall_pts[36].x, wall_pts[36].y,
  342.         values.wall_height, wall_pts[36].x, wall_pts[36].y, 0.0f, wall_pts[35].x, wall_pts[35].y, 0.0f);
  343.  
  344.     wall_side.Set_Position(32, wall_pts[36].x, wall_pts[36].y, values.wall_height, wall_pts[37].x, wall_pts[37].y,
  345.         values.wall_height, wall_pts[37].x, wall_pts[37].y, 0.0f, wall_pts[36].x, wall_pts[36].y, 0.0f);
  346.  
  347.     // Top Right Corner
  348.     for (x1=0;x1<9;x1=x1+1)
  349.         {
  350.             wall_side.Set_Texture_Position(x1+33, 0.111f * x1, 1.0f, (1 + x1) * 0.111f, 1.0f, (1 + x1) * 0.111f, 0.0f, 0.111f * x1, 0.0f);
  351.             wall_side.Set_Position(x1+33, wall_pts[37 + x1].x, wall_pts[37 + x1].y, values.wall_height, wall_pts[38 + x1].x,
  352.                 wall_pts[38 + x1].y, values.wall_height, wall_pts[38 + x1].x, wall_pts[38 + x1].y, 0.0f, wall_pts[37 + x1].x,
  353.                 wall_pts[37 + x1].y, 0.0f);
  354.         }
  355.  
  356.     // Right Wall
  357.     wall_side.Set_Position(42, wall_pts[46].x, wall_pts[46].y, values.wall_height, wall_pts[47].x, wall_pts[47].y,
  358.         values.wall_height, wall_pts[47].x, wall_pts[47].y, 0.0f, wall_pts[46].x, wall_pts[46].y, 0.0f);
  359.  
  360.     wall_net.Set_Position(3, wall_pts[47].x, wall_pts[47].y, values.wall_height, wall_pts[48].x, wall_pts[48].y,
  361.         values.wall_height, wall_pts[48].x, wall_pts[48].y, 0.0f, wall_pts[47].x, wall_pts[47].y, 0.0f);
  362.  
  363.     wall_side.Set_Position(43, wall_pts[48].x, wall_pts[48].y, values.wall_height, wall_pts[49].x, wall_pts[49].y,
  364.         values.wall_height, wall_pts[49].x, wall_pts[49].y, 0.0f, wall_pts[48].x, wall_pts[48].y, 0.0f);
  365. }
  366.  
  367. /***************************************************************************/
  368.  
  369. void Initialize_Wall_Points(float radius, float length_top, float length_sides)
  370.  
  371. {
  372.     float        interval = 1.0f;
  373.     float2    temp;
  374.     int            x1;
  375.  
  376.     length_top = length_top - radius - radius;
  377.     length_sides = length_sides - radius - radius;
  378.     radius = radius;
  379.  
  380.     wall_pts[1].x = wall_pts[49].x = 150.0f;
  381.     wall_pts[1].y = wall_pts[49].y = -50.0f;
  382.  
  383.     for (x1=2;x1<10;x1=x1+1)
  384.         {
  385.             interval = (float)(x1 - 1);
  386.  
  387.             wall_pts[x1].x = 100.0f + (Cos_F(interval * 10.0f) * 50.0f);
  388.             wall_pts[x1].y = -100.0f - (Sin_F(interval * 10.0f) * 50.0f);
  389.         }
  390.  
  391.     wall_pts[10].x = 50.0f;
  392.     wall_pts[10].y = -150.0f;
  393.     wall_pts[11].x = 50.0f;
  394.     wall_pts[11].y = -190.0f;
  395.     wall_pts[12].x = -50.0f;
  396.     wall_pts[12].y = -190.0f;
  397.     wall_pts[13].x = -50.0f;
  398.     wall_pts[13].y = -150.0f;
  399.  
  400.     for (x1=14;x1<22;x1=x1+1)
  401.         {
  402.             interval = (float)(x1 - 13);
  403.  
  404.             wall_pts[x1].x = -100.0f - (Cos_F(interval * 10.0f) * 50.0f);
  405.             wall_pts[x1].y = -100.0f - (Sin_F(interval * 10.0f) * 50.0f);
  406.         }
  407.  
  408.     // Transfer 14 and 21
  409.     temp.x = wall_pts[14].x;                            temp.y = wall_pts[14].y;
  410.     wall_pts[14].x = wall_pts[21].x;            wall_pts[14].y = wall_pts[21].y;
  411.     wall_pts[21].x = temp.x;                            wall_pts[21].y = temp.y;
  412.  
  413.     // Transfer 15 and 20
  414.     temp.x = wall_pts[15].x;                            temp.y = wall_pts[15].y;
  415.     wall_pts[15].x = wall_pts[20].x;            wall_pts[15].y = wall_pts[20].y;
  416.     wall_pts[20].x = temp.x;                            wall_pts[20].y = temp.y;
  417.  
  418.     // Transfer 16 and 19
  419.     temp.x = wall_pts[16].x;                            temp.y = wall_pts[16].y;
  420.     wall_pts[16].x = wall_pts[19].x;            wall_pts[16].y = wall_pts[19].y;
  421.     wall_pts[19].x = temp.x;                            wall_pts[19].y = temp.y;
  422.  
  423.     // Transfer 17 and 18
  424.     temp.x = wall_pts[17].x;                            temp.y = wall_pts[17].y;
  425.     wall_pts[17].x = wall_pts[18].x;            wall_pts[17].y = wall_pts[18].y;
  426.     wall_pts[18].x = temp.x;                            wall_pts[18].y = temp.y;
  427.  
  428.     wall_pts[22].x = -150.0f;            wall_pts[22].y = -50.0f;
  429.     wall_pts[23].x = -190.0f;            wall_pts[23].y = -50.0f;
  430.     wall_pts[24].x = -190.0f;            wall_pts[24].y = 50.0f;
  431.     wall_pts[25].x = -150.0f;            wall_pts[25].y = 50.0f;
  432.  
  433.     for (x1=26;x1<34;x1=x1+1)
  434.         {
  435.             interval = (float)(x1 - 25);
  436.  
  437.             wall_pts[x1].x = -100.0f - (Cos_F(interval * 10.0f) * 50.0f);
  438.             wall_pts[x1].y = 100.0f + (Sin_F(interval * 10.0f) * 50.0f);
  439.         }
  440.  
  441.     wall_pts[34].x = -50.0f;            wall_pts[34].y = 150.0f;
  442.     wall_pts[35].x = -50.0f;            wall_pts[35].y = 190.0f;
  443.     wall_pts[36].x = 50.0f;                wall_pts[36].y = 190.0f;
  444.     wall_pts[37].x = 50.0f;                wall_pts[37].y = 150.0f;
  445.  
  446.     for (x1=38;x1<46;x1=x1+1)
  447.         {
  448.             interval = (float)(x1 - 37);
  449.  
  450.             wall_pts[x1].x = 100.0f + (Cos_F(interval * 10.0f) * 50.0f);
  451.             wall_pts[x1].y = 100.0f + (Sin_F(interval * 10.0f) * 50.0f);
  452.         }
  453.  
  454.     // Transfer 38 and 45
  455.     temp.x = wall_pts[38].x;                            temp.y = wall_pts[38].y;
  456.     wall_pts[38].x = wall_pts[45].x;            wall_pts[38].y = wall_pts[45].y;
  457.     wall_pts[45].x = temp.x;                            wall_pts[45].y = temp.y;
  458.  
  459.     // Transfer 39 and 44
  460.     temp.x = wall_pts[39].x;                            temp.y = wall_pts[39].y;
  461.     wall_pts[39].x = wall_pts[44].x;            wall_pts[39].y = wall_pts[44].y;
  462.     wall_pts[44].x = temp.x;                            wall_pts[44].y = temp.y;
  463.  
  464.     // Transfer 40 and 43
  465.     temp.x = wall_pts[40].x;                            temp.y = wall_pts[40].y;
  466.     wall_pts[40].x = wall_pts[43].x;            wall_pts[40].y = wall_pts[43].y;
  467.     wall_pts[43].x = temp.x;                            wall_pts[43].y = temp.y;
  468.  
  469.     // Transfer 41 and 42
  470.     temp.x = wall_pts[41].x;                            temp.y = wall_pts[41].y;
  471.     wall_pts[41].x = wall_pts[42].x;            wall_pts[41].y = wall_pts[42].y;
  472.     wall_pts[42].x = temp.x;                            wall_pts[42].y = temp.y;
  473.  
  474.     wall_pts[46].x = 150.0f;            wall_pts[46].y = 50.0f;
  475.     wall_pts[47].x = 190.0f;            wall_pts[47].y = 50.0f;
  476.     wall_pts[48].x = 190.0f;            wall_pts[48].y = -50.0f;
  477.  
  478.     // Initialize z value
  479.     for (x1=0;x1<50;x1=x1+1)
  480.         wall_pts[x1].z = 1.0f;
  481. }
  482.  
  483. /***************************************************************************/
  484.